{% extends 'base.html' %}
{% block content %}
    <!-- content srart -->

    <div class="am-g am-g-fixed blog-fixed yzq-blog-body">
        <div class="am-u-md-8 am-u-sm-12">
            <br>
            <small>为您搜索到 <span style="color: red;"> {{ search_count }} </span>篇含 <span
                    style="color: red"> {{ search_keyword }} </span>关键词的文章
            </small>
            <hr>
            <article class="am-g blog-entry-article">
                <div class=" am-u-lg-12 am-u-md-12 am-u-sm-12 blog-entry-text am-text-left">

                    {% autoescape off %}
                        {% for article in page_object %}
                            <h1><a href="/article/{{ article.category }}/{{ article.id }}/">{{ article.title }}</a></h1>
                            <a href="/article/{{ article.category }}/{{ article.id }}/">
                                {{ article.body|truncatechars_html:130 }}<h5>......点击查看全部</h5></a>
                            <a href="/article/{{ article.category }}/{{ article.id }}/" class="am-article-meta"
                               style="font-size: 1.5rem">
                            </a>
                            <p class="am-article-meta"><a href="" class="blog-continue">continue reading</a>
                                <span><a href="/article/{{ article.category }}/"
                                         class="am-icon-leaf"> {{ article.category }} &nbsp;</a></span>
                                <span class="am-icon-user"> {{ article.user.author_name }} &nbsp;</span>
                                <span class="am-icon-clock-o">&nbsp;{{ article.created_time }}&nbsp;</span>
                                <span class="am-icon-eye">&nbsp;{{ article.views }}&nbsp;</span>
                            </p>
                            <hr>
                        {% endfor %}
                    {% endautoescape %}
                </div>
            </article>

        </div>
        <!--  分页 -->
        <div class="am-g am-g-fixed blog-fixed yzq-blog-body">
            <div class="am-u-md-8 am-u-sm-12">
                <ul data-am-widget="pagination" class="am-pagination am-pagination-select am-no-layout">
                    {% if page_object.has_previous %}
                        <li class="am-pagination-prev"><a
                                href="?page={{ page_object.previous_page_number }}">上一页</a></li>
                    {% else %}
                        <li class="page-item disabled">
                            <a class="page-link" href="#" tabindex="-1"><i
                                    class="ion ion-chevron-left"></i></a>
                        </li>
                    {% endif %}

                    <li class="am-pagination-select"><a>{{ page_object.number }}/{{ paginator.num_pages }}</a></li>

                    {% if page_object.has_next %}
                        <li class="am-pagination-next"><a href="?page={{ page_object.next_page_number }}">下一页</a>
                            {% else %}
                        <li class="page-item disabled">
                            <a class="page-link" href="#" tabindex="-1"><i
                                    class="ion ion-chevron-left"></i></a>
                        </li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </div>

{% endblock %}
